<%@ Page Language="C#" AutoEventWireup="true" CodeFile="airports.aspx.cs" Inherits="airports" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="code"
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="code" HeaderText="code" ReadOnly="True" SortExpression="code" />
                <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" />
                <asp:BoundField DataField="d_chk_in_close" HeaderText="d_chk_in_close" SortExpression="d_chk_in_close" />
                <asp:BoundField DataField="i_chk_in_close" HeaderText="i_chk_in_close" SortExpression="i_chk_in_close" />
                <asp:BoundField DataField="dd_link_time" HeaderText="dd_link_time" SortExpression="dd_link_time" />
                <asp:BoundField DataField="di_link_time" HeaderText="di_link_time" SortExpression="di_link_time" />
                <asp:BoundField DataField="id_link_time" HeaderText="id_link_time" SortExpression="id_link_time" />
                <asp:BoundField DataField="ii_link_time" HeaderText="ii_link_time" SortExpression="ii_link_time" />
            </Columns>
        </asp:GridView>
        <br />
        <br />
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="code" DataSourceID="SqlDataSource1"
            DefaultMode="Insert">
            <EditItemTemplate>
                code:
                <asp:Label ID="codeLabel1" runat="server" Text='<%# Eval("code") %>'></asp:Label><br />
                city:
                <asp:TextBox ID="cityTextBox" runat="server" Text='<%# Bind("city") %>'>
                </asp:TextBox><br />
                d_chk_in_close:
                <asp:TextBox ID="d_chk_in_closeTextBox" runat="server" Text='<%# Bind("d_chk_in_close") %>'>
                </asp:TextBox><br />
                i_chk_in_close:
                <asp:TextBox ID="i_chk_in_closeTextBox" runat="server" Text='<%# Bind("i_chk_in_close") %>'>
                </asp:TextBox><br />
                dd_link_time:
                <asp:TextBox ID="dd_link_timeTextBox" runat="server" Text='<%# Bind("dd_link_time") %>'>
                </asp:TextBox><br />
                di_link_time:
                <asp:TextBox ID="di_link_timeTextBox" runat="server" Text='<%# Bind("di_link_time") %>'>
                </asp:TextBox><br />
                id_link_time:
                <asp:TextBox ID="id_link_timeTextBox" runat="server" Text='<%# Bind("id_link_time") %>'>
                </asp:TextBox><br />
                ii_link_time:
                <asp:TextBox ID="ii_link_timeTextBox" runat="server" Text='<%# Bind("ii_link_time") %>'>
                </asp:TextBox><br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                    Text="Update">
                </asp:LinkButton>
                <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="Cancel">
                </asp:LinkButton>
            </EditItemTemplate>
            <InsertItemTemplate>
                code:
                <asp:TextBox ID="codeTextBox" runat="server" Text='<%# Bind("code") %>'>
                </asp:TextBox><br />
                city:
                <asp:TextBox ID="cityTextBox" runat="server" Text='<%# Bind("city") %>'>
                </asp:TextBox><br />
                d_chk_in_close:
                <asp:TextBox ID="d_chk_in_closeTextBox" runat="server" Text='<%# Bind("d_chk_in_close") %>'>
                </asp:TextBox><br />
                i_chk_in_close:
                <asp:TextBox ID="i_chk_in_closeTextBox" runat="server" Text='<%# Bind("i_chk_in_close") %>'>
                </asp:TextBox><br />
                dd_link_time:
                <asp:TextBox ID="dd_link_timeTextBox" runat="server" Text='<%# Bind("dd_link_time") %>'>
                </asp:TextBox><br />
                di_link_time:
                <asp:TextBox ID="di_link_timeTextBox" runat="server" Text='<%# Bind("di_link_time") %>'>
                </asp:TextBox><br />
                id_link_time:
                <asp:TextBox ID="id_link_timeTextBox" runat="server" Text='<%# Bind("id_link_time") %>'>
                </asp:TextBox><br />
                ii_link_time:
                <asp:TextBox ID="ii_link_timeTextBox" runat="server" Text='<%# Bind("ii_link_time") %>'>
                </asp:TextBox><br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                    Text="Insert">
                </asp:LinkButton>
                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="Cancel">
                </asp:LinkButton>
            </InsertItemTemplate>
            <ItemTemplate>
                code:
                <asp:Label ID="codeLabel" runat="server" Text='<%# Eval("code") %>'></asp:Label><br />
                city:
                <asp:Label ID="cityLabel" runat="server" Text='<%# Bind("city") %>'></asp:Label><br />
                d_chk_in_close:
                <asp:Label ID="d_chk_in_closeLabel" runat="server" Text='<%# Bind("d_chk_in_close") %>'>
                </asp:Label><br />
                i_chk_in_close:
                <asp:Label ID="i_chk_in_closeLabel" runat="server" Text='<%# Bind("i_chk_in_close") %>'>
                </asp:Label><br />
                dd_link_time:
                <asp:Label ID="dd_link_timeLabel" runat="server" Text='<%# Bind("dd_link_time") %>'>
                </asp:Label><br />
                di_link_time:
                <asp:Label ID="di_link_timeLabel" runat="server" Text='<%# Bind("di_link_time") %>'>
                </asp:Label><br />
                id_link_time:
                <asp:Label ID="id_link_timeLabel" runat="server" Text='<%# Bind("id_link_time") %>'>
                </asp:Label><br />
                ii_link_time:
                <asp:Label ID="ii_link_timeLabel" runat="server" Text='<%# Bind("ii_link_time") %>'>
                </asp:Label><br />
                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                    Text="Edit">
                </asp:LinkButton>
                <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                    Text="Delete">
                </asp:LinkButton>
                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                    Text="New">
                </asp:LinkButton>
            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SparrowDB %>"
            DeleteCommand="DELETE FROM [airports] WHERE [code] = @code" InsertCommand="INSERT INTO [airports] ([code], [city], [d_chk_in_close], [i_chk_in_close], [dd_link_time], [di_link_time], [id_link_time], [ii_link_time]) VALUES (@code, @city, @d_chk_in_close, @i_chk_in_close, @dd_link_time, @di_link_time, @id_link_time, @ii_link_time)"
            SelectCommand="SELECT * FROM [airports]" UpdateCommand="UPDATE [airports] SET [city] = @city, [d_chk_in_close] = @d_chk_in_close, [i_chk_in_close] = @i_chk_in_close, [dd_link_time] = @dd_link_time, [di_link_time] = @di_link_time, [id_link_time] = @id_link_time, [ii_link_time] = @ii_link_time WHERE [code] = @code">
            <DeleteParameters>
                <asp:Parameter Name="code" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="city" Type="String" />
                <asp:Parameter Name="d_chk_in_close" Type="Byte" />
                <asp:Parameter Name="i_chk_in_close" Type="Byte" />
                <asp:Parameter Name="dd_link_time" Type="Byte" />
                <asp:Parameter Name="di_link_time" Type="Byte" />
                <asp:Parameter Name="id_link_time" Type="Byte" />
                <asp:Parameter Name="ii_link_time" Type="Byte" />
                <asp:Parameter Name="code" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="code" Type="String" />
                <asp:Parameter Name="city" Type="String" />
                <asp:Parameter Name="d_chk_in_close" Type="Byte" />
                <asp:Parameter Name="i_chk_in_close" Type="Byte" />
                <asp:Parameter Name="dd_link_time" Type="Byte" />
                <asp:Parameter Name="di_link_time" Type="Byte" />
                <asp:Parameter Name="id_link_time" Type="Byte" />
                <asp:Parameter Name="ii_link_time" Type="Byte" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
